﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

// std headers
#include <string>

// qt headers

// gcmp headers

// custom headers
#include "GcsTools.h"


namespace gmepgcs
{

    struct FamilyParameterDefinitions
    {
        std::wstring name;
        std::wstring guid;
        std::wstring groupName;
        std::wstring paramType;
        bool instance = true;
        std::wstring standardType;
        std::wstring standardCode;
        std::map<std::wstring, std::wstring> enumList;
    };

    class GCS_TOOLS_EXPORTS GacZipUtils
    {
    public:
        explicit GacZipUtils() = default;
        GacZipUtils(const GacZipUtils &) = delete;
        GacZipUtils &operator=(const GacZipUtils &) = delete;
        virtual ~GacZipUtils() = default;

    public:
        static bool UpdateFamilyParameterXml(const std::wstring gacFilePath, const std::wstring xmlFilePath);
        static std::wstring GetCategoryGuid(const std::wstring gacFilePath);
        static void GetProjectAppInfo(const std::wstring &gacFilePath, std::wstring &projectAppName, std::wstring &projectAppVersion, std::wstring &componentEditorVersion = std::wstring(), std::wstring& mergedFamily = std::wstring());
        static std::string GetFamilyParametersXml(const std::wstring gacFilePath);

        // for New Library API
        static bool GetCategoryInfoFromGacFile(const std::wstring& gacFilePath, std::map<std::wstring, std::wstring>& categoryInfo);
    };
}